package com.pig4cloud.pig.consumer.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pig4cloud.pig.admin.api.entity.NewsList;
import com.pig4cloud.pig.consumer.mapper.NewsListMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/news")
public class NewsController {


	@Autowired
	private NewsListMapper newsListMapper;

	@GetMapping("/test")
	public List<NewsList> test() {
		QueryWrapper<NewsList> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("title","詹姆斯");
		return newsListMapper.selectList(queryWrapper);
	}

}
